package com.ideabove.heart.alarm;

import com.ideabove.heart.util.LogUtil;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class BootReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(final Context context, final Intent intent) {
            if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
                    Intent mServiceIntent = new Intent(context, BootService.class);                    
//                    mServiceIntent.setAction("com.ideabove.heart.alarm.BootService");                    
                    ComponentName service = context.startService(mServiceIntent);
                    if (null == service) {
                            // something really wrong here
//                            Toast toast = Toast.makeText(context, "Could not start service ",Toast.LENGTH_LONG); 
//                            toast.show(); 
                    }
                    
//                    Toast toast = Toast.makeText(context, "start service ",Toast.LENGTH_LONG); 
//                    toast.show(); 
                    
            } else {
            	LogUtil.e("Received unexpected intent " + intent.toString());
            }
    }
}
